set(INFERENCE_PROJECT_NAME "inference")
unset(INFERENCE_ROOT)
find_path(INFERENCE_ROOT NAMES ${INFERENCE_PROJECT_NAME} HINTS ${BOLT_ROOT} $ENV{BOLT_ROOT})
set(INFERENCE_ROOT "${INFERENCE_ROOT}/${INFERENCE_PROJECT_NAME}")

set(INFERENCE_INCLUDE_DIR "${INFERENCE_ROOT}/include")
if (USE_DYNAMIC_LIBRARY)
    set(INFERENCE_LIBRARY "${INFERENCE_ROOT}/lib/lib${INFERENCE_PROJECT_NAME}.so")
else (USE_DYNAMIC_LIBRARY)
    set(INFERENCE_LIBRARY "${INFERENCE_ROOT}/lib/lib${INFERENCE_PROJECT_NAME}.a")
endif (USE_DYNAMIC_LIBRARY)

if (INFERENCE_INCLUDE_DIR AND INFERENCE_LIBRARY)
    set(INFERENCE_FOUND true)
endif (INFERENCE_INCLUDE_DIR AND INFERENCE_LIBRARY)

find_package(BlasEnhance)
find_package(TensorComputing)
find_package(ModelTools)
find_package(Image)

if (INFERENCE_FOUND)
    set(INFERENCE_LIBRARIES "${INFERENCE_LIBRARY};${IMAGE_LIBRARY};${MODEL_TOOLS_LIBRARY};${TENSOR_COMPUTING_LIBRARY};${BLAS_ENHANCE_LIBRARY}")
    include_directories(include ${INFERENCE_INCLUDE_DIR})
    message(STATUS "Found ${INFERENCE_PROJECT_NAME}.hpp: ${INFERENCE_INCLUDE_DIR}")
    message(STATUS "Found ${INFERENCE_PROJECT_NAME}: ${INFERENCE_LIBRARIES}")
else (INFERENCE_FOUND)
    message(FATAL_ERROR "
FATAL: can not find ${INFERENCE_PROJECT_NAME} library in <BOLT_ROOT>/${INFERENCE_PROJECT_NAME}/[include/lib] directory,
       please set shell or cmake environment variable BOLT_ROOT.
    ")
endif (INFERENCE_FOUND)

message(STATUS ${INFERENCE_LIBRARIES})
